package com.teamwings.enums;


public enum CtrlTypeEnum {

    OA_DICT(1, "oaDict"),
    OA_DOCTYPE(2, "oaDoctype"),
    OA_DEPT(3, "oaDept"),
    OA_USER(4, "oaUser"),
    OA_COMMENT(5, "oaComment"),
    OA_SEND_DEPT(6, "oaSendDept"),
    OA_SEND_USER(7, "oaSendUser"),
    OA_UNIT(8, "oaUnit"),
    OA_TABLE(9, "oaTable"),
    OA_UPLOAD(10, "upload"),
    OA_LOGIC_TABLE(11, "oaLogicTable"),
    OA_SEND_USER_BY_DEPT(12, "oaSendUserByDept"),
    OA_FIELDS_CHANGE_VIEW(13, "oaFieldsChangeView"),
    ;

    private int code;
    private String name;

    CtrlTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    // 普通方法
    public static Integer getCode(String name) {
        for (CtrlTypeEnum c : CtrlTypeEnum.values()) {
            if (c.name.equals(name)) {
                return c.code;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

}
